let lex=require("../lex");
module.exports = grammar_ll1;
function grammar_ll1(){
    let collector =[];
    let lex_result=[];
    let main_index=0;


    this.push_collector = function(inn){
        collector.push(inn);
    };
    this.pop_collector = function(){
        return collector.pop();
    };
    this.log_collector = function(){
        console.log(collector);
    };
    this.return_collector=function(){
        return collector;
    };

    // this.get_next_lex = function(){
    //     main_index++;
    //     return lex_result[main_index-1];
    // };
    this.nextlex = function (){
        main_index+=2;
    };
    this.get_lex = function(){
        return lex_result[main_index];
    };
    this.get_inn = function(){
        return lex_result[main_index+1];
    };
    this.get_lex = function(index){
        return lex_result[index];
    };

    this.set_lex = function(index,inn){
        lex_result[index]=inn;
    };
    this.init_lex = function(text){
        lex_result=lex.lexFirst(text[0]);
    };

}